package com.example.demo.entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @Author zengqingfa
 * @Created in    2020/2/20  21:05
 * @Description
 */
public class Employee {

    private String id;
    private String name;
    private Integer sex;
    private Integer age;

    public static List<Employee> getEmployees() {
        List<Employee> employees = new ArrayList<>();
        employees.add(new Employee("1001", "Lily", 0, 33));
        employees.add(new Employee("1002", "雷军", 1, 23));
        employees.add(new Employee("1003", "马化腾", 1, 56));
        employees.add(new Employee("1004", "Lucy", 0, 24));
        employees.add(new Employee("1005", "Tom", 1, 15));
        employees.add(new Employee("1006", "马云", 1, 66));
        employees.add(new Employee("1007", "比尔盖茨", 1, 45));
        return employees;
    }

    public Employee() {
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Employee(String id, String name, Integer sex) {
        this.id = id;
        this.name = name;
        this.sex = sex;
    }

    public Employee(String id, String name, Integer sex, Integer age) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return Objects.equals(id, employee.id) &&
                Objects.equals(name, employee.name) &&
                Objects.equals(sex, employee.sex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, sex);
    }
}
